package com.bestcem.xm.common.core.sequence.dao.mapper;

import com.bestcem.xm.common.core.sequence.entity.SequenceEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

/**
 * 示例服务
 *
 * @author yf.wang <yf.wang@idiaoyan.com>
 * @version V1.0
 * @date 2021/9/17
 */
@Mapper
public interface SequenceMapper {

    /**
     * 根据code获取信息
     *
     * @param code
     * @return
     */
    SequenceEntity findOneByCode(@Param("code") String code);


    /**
     * 根据id 更新数据
     *
     * @param entity
     * @return
     */
    int updateById(SequenceEntity entity);

    /**
     * 根据id 更新数据
     *
     * @param entity
     * @return
     */
    //int updateSeqById(SequenceEntity entity);

    /**
     * 创建 序号
     *
     * @param sequence
     */
    void createSequence(SequenceEntity sequence);

    /**
     * 批量创建 序号
     *
     * @param sequence
     */
    void batchCreate(List<SequenceEntity> sequence);

    /**
     * 更新seq
     *
     * @param seq
     * @param code
     */
    void updateSeqByCode(@Param("seq") Integer seq, @Param("code") String code);

    /**
     * 批量更新seq
     *
     * @param sequenceList
     * @return void
     * @author panyun <yun.pan@idiaoyan.com>
     * @date 2022/7/21 14:53
     */
    void batchUpdateSeq(List<SequenceEntity> sequenceList);

    /**
     * 根据code批量查找
     *
     * @param codes
     * @return java.util.ArrayList<com.bestcem.xm.member.entity.pojo.SequenceDO>
     * @author panyun <yun.pan@idiaoyan.com>
     * @date 2022/8/1 15:06
     */
    ArrayList<SequenceEntity> listByCodes(ArrayList<String> codes);
}
